home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / et / et3_0-a1.lha / et3 / postscript / et-2.2-0.ps next >
Text File  |  1992-02-06  |  21KB  |  1,024 lines

  1. %%BeginProcSet: et 2.2 0
  2.  
  3. %---- utilities -----------------------------------------------------------------
  4.  
  5. /ET++Dict 130 dict def
  6.  
  7. ET++Dict begin
  8.  
  9. %---- bdef ----------------------------------------------------------------------
  10.  
  11. /bdef {
  12.     bind def
  13. } bind def
  14.  
  15. %---- ctoi ----------------------------------------------------------------------
  16.  
  17. /ctoi {
  18.     dup
  19.     127 gt {
  20.     256 sub
  21.     } if
  22. } bdef
  23.  
  24. %---- SetPenSize ----------------------------------------------------------------
  25.  
  26. % psz SetPenSize -
  27. /SetPenSize {
  28.     /psz exch def
  29. } bdef
  30.  
  31. %---- cm ------------------------------------------------------------------------
  32.  
  33. % n cm n
  34. /cm {
  35.     72 2.54 div mul
  36. } bdef
  37.  
  38. %---- halftones and patterns ----------------------------------------------------
  39.  
  40. /$SetPattern-Dict 10 dict def
  41.  
  42. /setpattern {
  43.     $SetPattern-Dict begin
  44.     /bstring exch def
  45.     9.375 0 {
  46.         1 add 4 mul cvi bstring exch get exch
  47.         1 add 4 mul cvi 7 sub bitshift 1 and
  48.     } setscreen
  49.     /onbits 0 def
  50.     /offbits 0 def
  51.     0 1 63 {
  52.         /i exch def
  53.         bstring i 8 idiv get 1 7 i 8 mod sub bitshift and 0 ne {
  54.         /onbits onbits 1 add def
  55.         } {
  56.         /offbits offbits 1 add def
  57.         } ifelse
  58.     } for
  59.     offbits 64 div setgray
  60.     /setfreq true def
  61.     end
  62. } bdef
  63.  
  64. $SetPattern-Dict begin
  65.     /setfreq false def
  66.     currentscreen
  67.     /spot exch def
  68.         /angle exch def
  69.         /freq exch def
  70. end
  71.  
  72. %---- SetPattern ----------------------------------------------------------------
  73.  
  74. % hexstring SetPattern -
  75. /SetPattern {
  76.     $SetPattern-Dict begin
  77.     setfreq {
  78.         freq angle /spot load setscreen
  79.         /setfreq false def
  80.     } if
  81.     setpattern
  82.     end
  83. } bdef
  84.  
  85. %---- SetGray ------------------------------------------------------------------
  86.  
  87. % value SetGray -
  88. /SetGray {
  89.     $SetPattern-Dict begin
  90.     setfreq {
  91.         freq angle /spot load setscreen
  92.         /setfreq false def
  93.     } if
  94.     setgray
  95.     end
  96. } bdef
  97.  
  98. %---- FillRect ----------------------------------------------------------------
  99.  
  100. /$FillRect-Dict 5 dict def
  101.  
  102. % left top wd ht FillRect
  103. /FillRect {
  104.     $FillRect-Dict begin
  105.     /ht exch def
  106.     /wd exch def
  107.     /top exch def
  108.     /left exch def
  109.     
  110.     gsave
  111.         /svmx mtrx currentmatrix def  % save old matrix
  112.         left top translate
  113.         wd ht scale
  114.         newpath
  115.         0 0 moveto
  116.         1 0 lineto
  117.         1 1 lineto
  118.         0 1 lineto
  119.         closepath
  120.         svmx setmatrix              % restore old matrix
  121.         fill
  122.     grestore
  123.     end
  124. } bdef
  125.  
  126. %---- StrokeRect ----------------------------------------------------------------
  127.  
  128. /$StrokeRect-Dict 5 dict def
  129.  
  130. % left top wd ht StrokeRect
  131. /StrokeRect {
  132.     $StrokeRect-Dict begin
  133.     /ht exch def
  134.     /wd exch def
  135.     /top exch def
  136.     /left exch def
  137.     
  138.     gsave
  139.         /svmx mtrx currentmatrix def  % save old matrix
  140.         left psz 2 div add top psz 2 div add translate
  141.         wd psz sub ht psz sub scale
  142.         newpath
  143.         0 0 moveto
  144.         1 0 lineto
  145.         1 1 lineto
  146.         0 1 lineto
  147.         closepath
  148.         svmx setmatrix              % restore old matrix
  149.         psz setlinewidth
  150.         % psz psz scale
  151.         stroke
  152.     grestore
  153.     end
  154. } bdef
  155.  
  156. %---- FillPoly ----------------------------------------------------------------
  157.  
  158. /$FillPoly-Dict 11 dict def
  159.  
  160. % left top wd ht clos pts rwd rht spl FillPoly -
  161. /FillPoly {
  162.     $FillPoly-Dict begin
  163.     /pts exch def
  164.     /rht exch def
  165.     /rwd exch def
  166.     /spl exch def
  167.     /clos exch def
  168.     /ht exch def
  169.     /wd exch def
  170.     /top exch def
  171.     /left exch def
  172.     
  173.     gsave
  174.         /svmx mtrx currentmatrix def
  175. %           left top ht add translate
  176. %           wd rwd div ht rht div neg scale
  177.         left top translate
  178.         wd rwd div ht rht div scale
  179.         
  180.         newpath
  181.         pts 0 get pts 1 get moveto
  182.         spl 0 eq {
  183.         2 2 pts length 1 sub {
  184.             /i exch def
  185.             pts i get pts i 1 add get lineto
  186.         } for
  187.         } {
  188.         2 6 pts length 1 sub {
  189.             /i exch def
  190.             pts i get pts 1 i add get
  191.             pts 2 i add get pts 3 i add get
  192.                 pts 4 i add get pts 5 i add get
  193.                 curveto
  194.         } for
  195.         } ifelse
  196.         clos 1 eq {
  197.         closepath
  198.         } if
  199.         svmx setmatrix
  200.         eofill
  201.     grestore
  202.     end
  203. } bdef
  204.  
  205. %---- StrokePoly ----------------------------------------------------------------
  206.  
  207. /$StrokePoly-Dict 11 dict def
  208.  
  209. % left top wd ht clos pts rwd rht spl StrokePoly -
  210. /StrokePoly {
  211.     $StrokePoly-Dict begin
  212.     /pts exch def
  213.     /rht exch def
  214.     /rwd exch def
  215.     /spl exch def
  216.     /clos exch def
  217.     /ht exch def
  218.     /wd exch def
  219.     /top exch def
  220.     /left exch def
  221.     
  222.     gsave
  223.         /svmx mtrx currentmatrix def
  224. %            left top ht add translate
  225. %            wd rwd div ht rht div neg scale
  226.         left top translate
  227.         wd rwd div ht rht div scale
  228.         
  229.         pts 0 get pts 1 get moveto
  230.         spl 0 eq {
  231.         2 2 pts length 1 sub {
  232.             /i exch def
  233.             pts i get pts i 1 add get lineto
  234.         } for
  235.         } {
  236.         2 6 pts length 1 sub {
  237.             /i exch def
  238.             pts i get pts 1 i add get
  239.             pts 2 i add get pts 3 i add get
  240.                 pts 4 i add get pts 5 i add get
  241.                 curveto
  242.         } for
  243.         } ifelse
  244.         clos 1 eq {
  245.         closepath
  246.         } if
  247.         svmx setmatrix
  248.         psz setlinewidth
  249.         stroke
  250.     grestore
  251.     end
  252. } bdef
  253.  
  254. %---- docorner ------------------------------------------------------------------
  255.  
  256. /$docorner-dict 1 dict def
  257.  
  258. % startangle endangle xrad yrad xpos ypos docorner
  259. /docorner {
  260.     $docorner-dict begin
  261.     /savematrix mtrx currentmatrix def
  262.     translate
  263.     scale
  264.     0 0 1 5 -2 roll arc
  265.     savematrix setmatrix
  266.     end
  267. } bdef
  268.  
  269. %---- StrokeRoundRect ------------------------------------------------------------------
  270.  
  271. /$StrokeRoundRect-Dict 8 dict def
  272.  
  273. % left top wd ht owd oht StrokeRoundRect -
  274. /StrokeRoundRect {
  275.     $StrokeRoundRect-Dict begin
  276.     /oht exch psz sub 2 div def
  277.     /owd exch psz sub 2 div def
  278.     /ht exch def
  279.     /wd exch def
  280.     /top exch def
  281.     /left exch def
  282.  
  283.     /ht1 ht psz sub 2 div def
  284.     /wd1 wd psz sub 2 div def
  285.     gsave
  286.         left psz 2 div add wd1 add top psz 2 div add ht1 add translate
  287.         newpath
  288.         0 90     owd oht  wd1 owd sub      ht1 oht sub      docorner
  289.         90 180   owd oht  wd1 neg owd add  ht1 oht sub      docorner
  290.         180 270  owd oht  wd1 neg owd add  ht1 neg oht add  docorner
  291.         270 360  owd oht  wd1 owd sub      ht1 neg oht add  docorner
  292.         closepath
  293.         psz setlinewidth
  294.         stroke
  295.     grestore
  296.     end
  297. } bdef 
  298.  
  299. %---- FillRoundRect ------------------------------------------------------------------
  300.  
  301. /$FillRoundRect-Dict 8 dict def
  302.  
  303. % left top wd ht owd oht FillRoundRect -
  304. /FillRoundRect {
  305.     $FillRoundRect-Dict begin
  306.     /oht exch 2 div def
  307.     /owd exch 2 div def
  308.     /ht exch def
  309.     /wd exch def
  310.     /top exch def
  311.     /left exch def
  312.     
  313.     /ht1 ht 2 div def
  314.     /wd1 wd 2 div def
  315.         
  316.     gsave            
  317.         left wd1 add top ht1 add translate
  318.         newpath
  319.         0 90     owd oht  wd1 owd sub      ht1 oht sub      docorner
  320.         90 180   owd oht  wd1 neg owd add  ht1 oht sub      docorner
  321.         180 270  owd oht  wd1 neg owd add  ht1 neg oht add  docorner
  322.         270 360  owd oht  wd1 owd sub      ht1 neg oht add  docorner
  323.         closepath
  324.         fill
  325.     grestore
  326.     end
  327. } bdef 
  328.  
  329. %---- StrokeOval ------------------------------------------------------------------
  330.  
  331. /$StrokeOval-Dict 5 dict def
  332.  
  333. % left top wd ht StrokeOval -
  334. /StrokeOval {
  335.     $StrokeOval-Dict begin
  336.     /ht exch def
  337.     /wd exch def
  338.     /top exch def
  339.     /left exch def
  340.     
  341.     gsave
  342.         /svmx mtrx currentmatrix def
  343.         left psz 2 div add top psz 2 div add translate
  344.         wd psz sub ht psz sub scale
  345.         newpath
  346.         0.5 0.5 0.5 0 360 arc
  347.         svmx setmatrix
  348.         psz setlinewidth
  349.         stroke
  350.     grestore
  351.     end
  352. } bdef 
  353.  
  354. %---- FillOval ------------------------------------------------------------------
  355.  
  356. /$FillOval-Dict 5 dict def
  357.  
  358. % left top wd ht FillOval -
  359. /FillOval {
  360.     $FillOval-Dict begin
  361.     /ht exch def
  362.     /wd exch def
  363.     /top exch def
  364.     /left exch def
  365.     gsave
  366.         /svmx mtrx currentmatrix def
  367.         left top translate
  368.         wd ht scale
  369.         newpath
  370.         0.5 0.5 0.5 0 360 arc
  371.         svmx setmatrix
  372.         fill
  373.     grestore
  374.     end
  375. } bdef
  376.  
  377. %---- StrokeWedge ------------------------------------------------------------------
  378.  
  379. /$StrokeWedge-Dict 7 dict def
  380.  
  381. % left top wd ht startangle endangle StrokeWedge -
  382. /StrokeWedge {
  383.     $StrokeWedge-Dict begin
  384.     /$end exch def
  385.     /$start exch def
  386.     /ht exch def
  387.     /wd exch def
  388.     /top exch def
  389.     /left exch def
  390.     
  391.     gsave
  392.         /svmx mtrx currentmatrix def
  393.         left psz 2 div add top psz 2 div add translate
  394.         wd psz sub ht psz sub scale
  395.         newpath
  396.         0.5 0.5 0.5 $start $end add 90 sub $start 90 sub arcn
  397.         svmx setmatrix
  398.         psz setlinewidth
  399.         stroke
  400.     grestore
  401.     end
  402. } bdef 
  403.  
  404. %---- StrokeWedge ------------------------------------------------------------------
  405.  
  406. /$FillWedge-Dict 7 dict def
  407.  
  408. % left top wd ht startangle endangle FillWedge -
  409. /FillWedge {
  410.     $FillWedge-Dict begin
  411.     /$end exch def
  412.     /$start exch def
  413.     /ht exch def
  414.     /wd exch def
  415.     /top exch def
  416.     /left exch def
  417.     gsave
  418.         /svmx mtrx currentmatrix def
  419.         left top translate
  420.         wd ht scale
  421.         newpath
  422.         0.5 0.5 moveto
  423.         0.5 0.5 0.5 $start $end add 90 sub $start 90 sub arcn
  424.         svmx setmatrix
  425.         fill
  426.     grestore
  427.     end
  428. } bdef
  429.  
  430. %---- StrokeArrow ---------------------------------------------------------------------
  431.  
  432. /$StrokeArrow-dict 14 dict def
  433.  
  434. % tipx tipy tailx taily mode StrokeArrow -
  435. /StrokeArrow {
  436.     $StrokeArrow-dict begin
  437.     /mode exch def
  438.     /taily exch def
  439.     /tailx exch def
  440.     /tipy exch def
  441.     /tipx exch def
  442.     
  443.     /lw psz def
  444.     /dx tipx tailx sub def    
  445.     /dy tipy taily sub def
  446.     dx 0 eq dy 0 eq and {
  447.         /angle 180 def
  448.     } {
  449.         /angle dy dx atan def
  450.     } ifelse
  451.     /arrowlength dx dx mul dy dy mul add sqrt def
  452.     /aw2 lw 2 mul def
  453.     /ah lw 7 mul def
  454.     
  455.     gsave
  456.         tailx taily translate
  457.         angle rotate
  458.             
  459.         mode 2 and 2 eq {
  460.         newpath
  461.             0 0 moveto
  462.             ah aw2 lineto
  463.             ah aw2 neg lineto
  464.             closepath
  465.             fill
  466.         /x1 ah def
  467.         } {
  468.         /x1 0 def
  469.         } ifelse
  470.         
  471.         mode 1 and 1 eq {
  472.         newpath
  473.             arrowlength 0 moveto
  474.             arrowlength ah sub aw2 lineto
  475.             arrowlength ah sub aw2 neg lineto
  476.             closepath
  477.             fill
  478.         /x2 arrowlength ah sub def
  479.         } {
  480.         /x2 arrowlength def
  481.         } ifelse
  482.         
  483.         psz setlinewidth
  484.         newpath
  485.         x1 0 moveto
  486.         x2 0 lineto
  487.         stroke
  488.     grestore
  489.     end
  490. } bdef
  491.  
  492. %---- SetClip -------------------------------------------------------------------
  493.  
  494. /$clip-dict 5 dict def
  495.  
  496. $clip-dict begin
  497.     /inclip false def
  498. end
  499.  
  500. % ulx uly wd ht SetClip -
  501. /SetClip {
  502.     $clip-dict begin
  503.        inclip { grestore } if
  504.        gsave
  505.        /inclip true def
  506.        /ht exch def
  507.        /wd exch def
  508.        /uly exch def
  509.        /ulx exch def
  510.        newpath
  511.        ulx uly moveto
  512.        wd 0 rlineto
  513.        0 ht rlineto
  514.        wd neg 0 rlineto
  515.        closepath
  516.        clip
  517.        newpath
  518.     end
  519. } bdef
  520.  
  521. % - Restore -
  522. /Restore {
  523.     $clip-dict begin
  524.        inclip { grestore } if
  525.        /inclip false def
  526.        restore
  527.     end
  528. } bdef
  529.  
  530. %---- Bitmap ------------------------------------------------------------------
  531.  
  532. /$Bitmap-Dict 11 dict def
  533.  
  534. % ulx uly wd ht xbits ybits depth Bitmap -
  535. /Bitmap {
  536.     gsave
  537.     $Bitmap-Dict begin
  538.     /depth exch def
  539.     /ybits exch def
  540.     /xbits exch def
  541.     /ht exch def
  542.     /wd exch def
  543.     /uly exch def
  544.     /ulx exch def
  545.     
  546.     ulx uly translate
  547.     
  548.     % wd xbits div ht ybits div scale
  549.     wd ht scale
  550.     
  551.     /s xbits 1 sub 8 idiv 1 add string def
  552.       
  553.     xbits
  554.     ybits
  555.     depth 1 eq { true } { depth } ifelse
  556.     [ xbits 0 0 ybits 0 0 ]
  557.     { currentfile s readhexstring pop }
  558.     depth 1 eq { imagemask } { image } ifelse
  559.     end
  560.     grestore
  561. } bdef
  562.  
  563. %---- SmoothBitmap --------------------------------------------------------------
  564.  
  565. /$SmoothBitmap-Dict 10 dict def
  566.  
  567. % scalex scaley ulx uly xbytes xbits SmoothBitmapStart
  568. /SmoothBitmapStart {
  569.     $SmoothBitmap-Dict begin
  570.     gsave
  571.     /xbits exch def
  572.     /xbytes exch def
  573.     /ypos 0 def
  574.     translate
  575.     scale
  576. } def
  577.  
  578. /SmoothBitmapEnd {
  579.     grestore
  580.     end
  581. } def
  582.  
  583. % ybits Band -
  584. /Band {    
  585.     /ybits exch def
  586.  
  587.     /@saveobj save def
  588.     
  589.     0 ypos transform round 0.5 sub exch round 0.5 sub exch itransform
  590.     translate
  591.     
  592.     xbits ybits scale
  593.     
  594.     newpath
  595.     0 0 moveto
  596.     
  597.     /s1 ybits 4 add xbytes mul string def        
  598.     /s2 ybits xbytes mul 4 bitshift string def 
  599.     
  600.     /4xbits xbits 2 bitshift def
  601.     /4ybits ybits 2 bitshift def
  602.     
  603.     xbytes 5 bitshift                       % 4 * number of xbits
  604.     4ybits                                  % 4 * number of ybits
  605.     true
  606.     [ 4xbits 0 0 4ybits 8 0 ]
  607.     {
  608.     s2                                  % workspace
  609.     currentfile s1 readhexstring pop    % read all at once
  610.     s2                                  % workspace
  611.     xbits 2 add                         % too bits wider
  612.     smooth                              % (stolen from laserprep: pssst!)
  613.     } imagemask
  614.     
  615.     @saveobj restore
  616.     /ypos ypos ybits add def
  617. } bdef
  618.  
  619. %---- sshow ---------------------------------------------------------------------
  620.  
  621. /$sshowdict 4 dict def
  622.  
  623. % (string) width sshow -
  624. /sshow {
  625.     $sshowdict begin
  626.     /w exch def
  627.     /s exch def
  628.     
  629.     /l s length 1 sub def
  630.     
  631.     l 0 eq {
  632.         s show
  633.     } {
  634.         /rw s stringwidth pop def
  635.         w rw sub l div 0 s ashow
  636.     } ifelse
  637.     end
  638. } bdef
  639.  
  640. %---- sshow ---------------------------------------------------------------------
  641.  
  642. /$bsshowdict 5 dict def
  643.  
  644. % (string) width blanks bsshow -
  645. /bsshow {
  646.     $bsshowdict begin
  647.     /b exch def
  648.     /w exch def
  649.     /s exch def
  650.     
  651.     /rw s stringwidth pop def
  652.     w rw sub b div 0 32 s widthshow
  653.     end
  654. } bdef
  655.  
  656. %---- addchar -------------------------------------------------------------------
  657.  
  658. /$addchar-dict 3 dict def
  659.  
  660. /addchar {
  661.     $addchar-dict begin
  662.     /charnum exch def
  663.     /metrics exch def
  664.     
  665.     /charname MacEncoding charnum get def
  666.     Encoding charnum charname put
  667.     
  668.     CharData begin
  669.         charname metrics def
  670.     end
  671.     end
  672. } def
  673.  
  674. %---- newbitmapfont -------------------------------------------------------------
  675.  
  676. /$newbitmapfont-dict 20 dict def
  677.  
  678. % fontname fid ps chars char_no llx lly urx ury newbitmapfont
  679. /newbitmapfont {
  680.     $newbitmapfont-dict begin
  681.     /ury exch def
  682.     /urx exch def
  683.     /lly exch def
  684.     /llx exch def
  685.     /chnos exch def
  686.     /all exch def
  687.     /pps exch def
  688.     /fid exch def
  689.     /fname exch def
  690.     
  691.     20 dict dup begin
  692.     
  693.     /FontType 3 def
  694.     /FontMatrix [ 1 0 0 1 0 0 ] def
  695.     /FontBBox [ llx pps div lly pps div urx pps div ury pps div ]  def
  696.     /Encoding 256 array def
  697.     /UniqueID fid def
  698.     /ps pps def
  699.     
  700.     0 1 255 {
  701.     Encoding exch /.notdef put
  702.     } for
  703.     
  704.     /BuildChar {
  705.     0 begin
  706.         /char exch def
  707.         /fontdict exch def
  708.         /charname fontdict /Encoding get char get def
  709.         /charinfo fontdict /CharData get charname get def
  710.         /ps fontdict /ps get def
  711.         
  712.         /wx charinfo 0 get def
  713.         /w charinfo 1 get def
  714.         /h charinfo 2 get def
  715.         /ox charinfo 3 get ctoi def
  716.         /oy charinfo 4 get ctoi def
  717.         
  718.         wx ps div
  719.           0
  720.         ox ps div
  721.           oy ps div
  722.             ox w add ps div
  723.               oy neg h add ps div
  724.             setcachedevice
  725.         
  726.         w
  727.         h
  728.         true
  729.         [
  730.           ps
  731.           0
  732.           0
  733.           ps neg
  734.           ox neg 0.5 sub
  735.           h oy add 0.5 sub
  736.         ]
  737.         { charinfo 5 charinfo length 5 sub getinterval }
  738.         imagemask
  739.     end
  740.     } def
  741.     
  742.     /BuildChar load 0 10 dict put
  743.     
  744.     /CharData chnos 1 add dict def
  745.     CharData begin
  746.     /.notdef <0F00000000> def
  747.     end
  748.     all {
  749.     dup dup 1 exch length 1 sub getinterval
  750.     exch 0 get
  751.     addchar
  752.     } forall
  753.  
  754.     end
  755.     
  756.     fname exch
  757.     end
  758.     definefont pop
  759. } def
  760.  
  761. %---- newsmoothedbitmapfont -------------------------------------------------------------
  762.  
  763. /$newsmoothedbitmapfont-dict 20 dict def
  764.  
  765. % fontname fid ps chars char_no llx lly urx ury newbitmapfont
  766. /newsmoothedbitmapfont {
  767.     $newsmoothedbitmapfont-dict begin
  768.     /ury exch def
  769.     /urx exch def
  770.     /lly exch def
  771.     /llx exch def
  772.     /chnos exch def
  773.     /all exch def
  774.     /pps exch def
  775.     /fid exch def
  776.     /fname exch def
  777.     
  778.     20 dict dup begin
  779.     
  780.     /FontType 3 def
  781.     /FontMatrix [ 1 0 0 1 0 0 ] def
  782.     /FontBBox [ llx pps div lly pps div urx pps div ury pps div ]  def
  783.     /Encoding 256 array def
  784.     /UniqueID fid def
  785.     /ps pps def
  786.     
  787.     0 1 255 {
  788.     Encoding exch /.notdef put
  789.     } for
  790.     
  791.     /BuildChar {
  792.     0 begin
  793.         /char exch def
  794.         /fontdict exch def
  795.         /charname fontdict /Encoding get char get def
  796.         /charinfo fontdict /CharData get charname get def
  797.         /ps fontdict /ps get def
  798.         
  799.         /wx charinfo 0 get def
  800.         /w charinfo 1 get def
  801.         /h charinfo 2 get def
  802.         /ox charinfo 3 get ctoi def
  803.         /oy charinfo 4 get ctoi def
  804.         /l charinfo length 5 sub def
  805.         /s1 charinfo 5 l getinterval def
  806.         /xbytes l h 4 add idiv def
  807.         /s2 h xbytes mul 16 mul string def
  808.         
  809.         wx ps div
  810.           0
  811.         ox ps div
  812.           oy ps div
  813.             ox w add ps div
  814.               oy neg h add ps div
  815.             setcachedevice
  816.         
  817.         xbytes 32 mul
  818.         h 4 mul
  819.         true
  820.         [
  821.           ps 4 mul
  822.           0
  823.           0
  824.           ps 4 mul neg
  825.           % ox neg 0.5 sub 4 mul
  826.           ox neg 2 add 4 mul
  827.           %h oy add 0.5 sub 4 mul
  828.           h oy add 4 mul
  829.         ]
  830.         {
  831.           s2
  832.           s1
  833.           s2
  834.           w 2 add
  835.           smooth
  836.         }
  837.         imagemask
  838.     end
  839.     } def
  840.     
  841.     /BuildChar load 0 20 dict put
  842.     
  843.     /CharData chnos 1 add dict def
  844.     CharData begin
  845.     /.notdef <0F00000000> def
  846.     end
  847.     all {
  848.     dup dup 1 exch length 1 sub getinterval
  849.     exch 0 get
  850.     addchar
  851.     } forall
  852.  
  853.     end
  854.     
  855.     fname exch 
  856.     end
  857.     definefont pop
  858. } def
  859.  
  860. %--------------------------------------------------------------------------------
  861.  
  862. /$reenc-dict 6 dict def
  863.  
  864. /Reencode {
  865.     $reenc-dict begin
  866.       /basefontname exch def
  867.       /basefont basefontname load exec def 
  868.  
  869.       /oldfontname basefont /FontName get dup length string cvs def
  870.  
  871.       /newfontname oldfontname length 1 add string def    % create string 
  872.       oldfontname newfontname copy pop            % copy old name to new name
  873.       newfontname oldfontname length 88 put       % append "X"
  874.  
  875.       /newfont basefont maxlength dict def        % define new font dict
  876.  
  877.       basefont {
  878.           exch dup /FID ne {
  879.               dup /Encoding eq {
  880.                   exch dup length array copy
  881.                   newfont 3 1 roll put
  882.               } {
  883.                   exch newfont 3 1 roll put
  884.               } ifelse
  885.           } {
  886.               pop pop
  887.           } ifelse
  888.       } forall
  889.  
  890.     newfont /FontName newfontname put   % set new fontname
  891.  
  892.     newfont /Encoding MacEncoding put
  893.     newfontname newfont definefont pop
  894.     
  895.     basefontname newfontname
  896.     end
  897.     findfont def
  898. } bdef
  899.  
  900. %---- scalesetfont --------------------------------------------------------------
  901.  
  902. /fontmtx [ 1 0 0 -1 0 0 ] def
  903.  
  904. % font ps scalesetfont -
  905. /scalesetfont {
  906.     scalefont fontmtx makefont setfont
  907. } bdef
  908.  
  909. %---- m -------------------------------------------------------------------------
  910.  
  911. % hpos vpos m -
  912. /m {
  913.     moveto
  914. } bdef
  915.  
  916. %---- init ----------------------------------------------------------------------
  917.  
  918. /$init-dict 4 dict def
  919.  
  920. % tx ty rot scalexy init -
  921. /init {
  922.   $init-dict begin
  923.     /scalexy exch def
  924.     /rot exch def
  925.     /ty exch def
  926.     /tx exch def
  927.     tx ty translate
  928.     rot rotate
  929.     scalexy scalexy neg scale
  930.   end
  931. } bdef
  932.  
  933. %---- strokeBBox ----------------------------------------------------------------
  934.  
  935. /$StrokeBBox-dict 4 dict def
  936.  
  937. % llx lly urx ury StrokeBBox -
  938. /StrokeBBox {
  939.   $StrokeBBox-dict begin
  940.     /ury exch def
  941.     /urx exch def
  942.     /lly exch def
  943.     /llx exch def
  944.  
  945.     gsave
  946.     0 setlinewidth
  947.     newpath
  948.     llx lly moveto
  949.     llx ury lineto
  950.     urx ury lineto
  951.     urx lly lineto
  952.     closepath
  953.     stroke
  954.     grestore
  955.   end
  956. } bdef
  957.  
  958. %---- EPSF ----------------------------------------------------------------------
  959.  
  960. /BeginEPSF {
  961.     /b4_Inc_state save def
  962.     /dict_count countdictstack def
  963.     /op_count count 1 sub def
  964.     userdict begin
  965.     /showpage { } def
  966.     0 setgray 0 setlinecap
  967.     1 setlinewidth 0 setlinejoin
  968.     10 setmiterlimit [] 0 setdash newpath
  969.     /laguagelevel where {
  970.     pop languagelevel 1 ne {
  971.         false strokeadjust false setoverprint
  972.     } if
  973.     } if
  974. } bdef
  975.  
  976. /EndEPSF {
  977.     count op_count sub { pop } repeat
  978.     countdictstack dict_count sub { end } repeat
  979.     b4_Inc_state restore
  980. } bdef
  981.  
  982. %---- make encoding vector ------------------------------------------------------
  983.  
  984. /MacEncoding 256 array def
  985.  
  986. MacEncoding 0 /Times-Roman findfont /Encoding get 0 128 getinterval putinterval
  987.  
  988. MacEncoding 17 /blumenkohl put
  989. MacEncoding 18 /checkmark put
  990. MacEncoding 19 /diamond put
  991. MacEncoding 20 /applelogo put
  992. MacEncoding 21 /applelogo1 put
  993. MacEncoding 22 /menuarrow put
  994. MacEncoding 39 /quotesingle put
  995. MacEncoding 96 /grave put
  996.  
  997. /Adieresis /Aring /Ccedilla /Eacute /Ntilde /Odieresis /Udieresis /aacute 
  998. /agrave /acircumflex /adieresis /atilde /aring /ccedilla /eacute /egrave 
  999. /ecircumflex /edieresis /iacute /igrave /icircumflex /idieresis /ntilde 
  1000. /oacute /ograve /ocircumflex /odieresis /otilde /uacute /ugrave /ucircumflex 
  1001. /udieresis /dagger /degree /cent /sterling /section /bullet /paragraph 
  1002. /germandbls /registersans /copyrightsans /trademarksans /acute /dieresis 
  1003. /notequal /AE /Oslash /infinity /plusminus /lessequal /greaterequal /yen /mu 
  1004. /partialdiff /summation /product /pi /integral /ordfeminine /ordmasculine 
  1005. /Omega /ae /oslash /questiondown /exclamdown /logicalnot /radical /florin 
  1006. /approxequal /Delta /guillemotleft /guillemotright /ellipsis /space /Aacute 
  1007. /Atilde /Otilde /OE /oe /endash /emdash /quotedblleft /quotedblright 
  1008. /quoteleft /quoteright /divide /lozenge /ydieresis /Ydieresis /fraction 
  1009. /currency /guilsinglleft /guilsinglright /fi /fl /daggerdbl /periodcentered 
  1010. /quotesinglbase /quotedblbase /perthousand /Acircumflex /Ecircumflex /Agrave 
  1011. /Edieresis /Egrave /Iacute /Icircumflex /Idieresis /Igrave /Oacute 
  1012. /Ocircumflex /apple /Ograve /Uacute /Ucircumflex /Ugrave /dotlessi /circumflex 
  1013. /tilde /macron /breve /dotaccent /ring /cedilla /hungarumlaut /ogonek /caron 
  1014.  
  1015. MacEncoding 128 128 getinterval astore pop
  1016.  
  1017. %--------------------------------------------------------------------------------
  1018.  
  1019. /mtrx matrix def
  1020.     
  1021. end
  1022.  
  1023. %%EndProcSet
  1024.